<template>
  <div >
    <div class="contentTopTitle">
      <div class="fl">
        <div class="title">市场经营通报</div>
      </div>
    </div>
    <div class="operation">
      <el-form :inline="true" :model="form" label-width="80px" class="formList">
     <!--  <el-form-item label="选择区域">
          <dx-cascader  :area_id.sync="form.areaId" />
        </el-form-item> -->
        <el-form-item label="账期">
          <el-date-picker v-model="form.month" value-format="yyyyMM" type="month" placeholder="选择月"></el-date-picker>
        </el-form-item>
        <el-form-item>
          <el-button size="small" type="primary" @click="submitHandle()">查询</el-button>
        </el-form-item>
        <el-form-item class="daochu">
          <el-button size="small" type="orange" @click="getPdf()">导出</el-button>
        </el-form-item>
      </el-form>
    </div>
    <div id="pdfDom" style="padding: 20px;">
        <generalOperation :areaId="form.areaId" :month="form.month" ref="tab1"></generalOperation>
        <mainRevenue :areaId="form.areaId" :month="form.month" ref="tab2"></mainRevenue>
        <branchIncome :areaId="form.areaId" :month="form.month" ref="tab3"></branchIncome>
        <revenueAnalysisBranch :areaId="form.areaId" :month="form.month" ref="tab4"></revenueAnalysisBranch>
        <overallTrend :areaId="form.areaId" :month="form.month" ref="tab5"></overallTrend>
        <branchCode :areaId="form.areaId" :month="form.month" ref="tab6"></branchCode>
        <coreRevenue :areaId="form.areaId" :month="form.month" ref="tab7"></coreRevenue>
        <costRevenue :areaId="form.areaId" :month="form.month" ref="tab8"></costRevenue>
        <centralIncome :areaId="form.areaId" :month="form.month" ref="tab9"></centralIncome>
        <mobileService :areaId="form.areaId" :month="form.month" ref="tab10"></mobileService>
        <broadband :areaId="form.areaId" :month="form.month" ref="tab11"></broadband>
    </div>
  </div>
</template>
<script>
  import generalOperation from "@/views/budget/showPdf/generalOperation";
  import mainRevenue from "@/views/budget/showPdf/mainRevenue";
  import branchIncome from "@/views/budget/showPdf/branchIncome";
  import revenueAnalysisBranch from "@/views/budget/showPdf/revenueAnalysisBranch";
  import overallTrend from "@/views/budget/showPdf/overallTrend";
  import branchCode from "@/views/budget/showPdf/branchCode";
  import coreRevenue from "@/views/budget/showPdf/coreRevenue";
  import costRevenue from "@/views/budget/showPdf/costRevenue";
  import centralIncome from "@/views/budget/showPdf/centralIncome";
  import mobileService from "@/views/budget/showPdf/mobileService";
  import broadband from "@/views/budget/showPdf/broadband";
  import { getSessionStorage } from "@/common/js/storage";
  let accountInfo = JSON.parse(getSessionStorage('accountInfo'))
  export default {
   name: "showpdf",
    components: {
        generalOperation,
        mainRevenue,
        branchIncome,
        revenueAnalysisBranch,
        overallTrend,
        branchCode,
        coreRevenue,
        costRevenue,
        centralIncome,
        mobileService,
        broadband,
    },
    data () {
      return {
        htmlTitle:'经营分析',
        form: {
          areaId: accountInfo.areaId,
          month: '',
        },
      }
    },
    created() {
      this.init();
      this.form.month = this.moment().subtract(1,'months').format('YYYYMM')
    },
    mounted(){
      this.submitHandle()
    },
    methods: {
      init() {
        this.accountInfo = JSON.parse(getSessionStorage("accountInfo"));
      },
     submitHandle() {
       this.$refs.tab1.getTotalMarketOperationSituation()
       this.$refs.tab2.getMainCampIncome()
       this.$refs.tab3.getCompanyIncomeComplete()
       this.$refs.tab4.getLdIncomeByProAndMajor()
       this.$refs.tab5.getAllData()
       this.$refs.tab6.getPlatformData()
       this.$refs.tab7.getTrendDataByAccMonth()
       this.$refs.tab8.getTrendDataByArea()
       this.$refs.tab9.getTrendDataByBranch()
       this.$refs.tab10.getMobileServiceData()
       this.$refs.tab11.getBroadbandServiceData()
     },
    },
  };

</script>

<style>
</style>
